package com.framework.service;

import com.baomidou.mybatisplus.service.IService;
import com.framework.entity.sys.SysLvRate;
import com.framework.entity.ter.TerTerminalInfo;
import com.framework.entity.tran.TranTransactionInfo;
import com.framework.view.PidRateView;

import java.math.BigDecimal;
import java.util.List;

/**
 * 功能描述: 终端等级分润统计
 *
 * @author ck
 * @date 2018/8/28 19:46
 */
public interface LvRateService extends IService<SysLvRate> {
	/**
	 * 查询等级
	 * @param agentId
	 * @param deptId
	 * @param terminalType
	 * @param isVip
	 * @return
	 */
	SysLvRate queryRate(Long agentId,Long deptId,Integer terminalType,String isVip);
	/**
	 * vip分级明细
	 * @return
	 * @param deptId
	 */
	List<SysLvRate> queryLvList(Long deptId);

	/**
	 * 用户报等级
	 * @param sn
	 * @param agentId
	 * @param deptId
	 * @param terminalType
	 * @param isVip
	 * @return
	 */
    BigDecimal queryYhbRate(String sn, Long agentId, Long deptId, int terminalType, String isVip);

	/**
	 * 查询等级比自己高的上级列表
	 * @param agentId
	 * @param terminalType
	 * @param isVip
	 * @return
	 */
    List<PidRateView> queryPidRate(Long agentId, int terminalType, String isVip);

	/**
	 * 根据交易获取分润费率
	 * @param tranTransactionInfo
	 * @param agentId
	 * @return
	 */
	SysLvRate getSysLvRate(TranTransactionInfo tranTransactionInfo, Long agentId);

	/**
	 * 获取用户宝交易费率
	 * @param agentId
	 * @param terminalInfo
	 * @param tranTransactionInfo
	 * @param rate
	 * @return
	 */
	BigDecimal getRateByYhb(Long agentId, TerTerminalInfo terminalInfo, TranTransactionInfo tranTransactionInfo, BigDecimal rate);

	/**
	 * 获取京东交易费率
	 * @param sn
	 * @return
	 */
	BigDecimal getJDPayRate(String sn);


	Integer getGradeByTran(BigDecimal tran,Long agentId,Long deptId);



	SysLvRate queryLvByGrade(Long deptId, Integer grade, Integer terminalType,String isVip);
}

